/*
 * The UserManager.java created for spikeCASservice projects. 
 */
package com.google.code.sip.ucenter.service;

import java.util.List;

import com.google.code.sip.core.dao.Page;
import com.google.code.sip.ucenter.model.User;
import com.google.code.sip.ucenter.model.UserCount;
import com.google.code.sip.ucenter.model.UserCustomProfile;
import com.google.code.sip.ucenter.model.UserEvent;
import com.google.code.sip.ucenter.model.UserProfile;

/**
 * Describes the <tt>UserManager</tt> object's responsibility, collaboration,
 * relationship and usage.
 * 
 * @author Yeung XP
 * @version 1.0 2010-5-26
 */
public interface UserManager {
	void saveUser(User user);

	/**
	 * 删除用户
	 * 
	 * @param id
	 *            待删除用户id
	 */
	void deleteUser(String id);

	/**
	 * 删除用户
	 * 
	 * @param user
	 *            待删除用户
	 */
	void deleteUser(User user);

	/**
	 * 删除用户
	 * 
	 * @param user
	 *            待删除用户
	 * @param totally
	 *            是否彻底删除
	 */
	void deleteUser(User user, boolean totally);

	User getUser(String userId);

	User getUserByName(String username);

	User getUserByEmail(String email);

	User getUser(String username, String email, String huoshowId);

	User getUserByHuoshowId(String huoshowId);

	boolean login(String username, String password);

	void setPassword(String userId, String password);

	void setPasswordByName(String username, String password);

	int getCreditCount(User user);

	List<UserCount> getCreditCount(List<User> users);

	void findUser(Page<User> page);

	void findNormalUser(Page<User> page);

	void findAdminUser(Page<User> page);

	long countUser();

	List<User> findUser(String propName, String propValue);

	boolean changePassword(String username, String oldPassword,
			String newPassword);

	UserProfile getProfile(String userId);

	UserProfile getProfile(User user);

	List<UserCustomProfile> getUserCustomProfiles(User user);

	List<UserCustomProfile> getUserCustomProfiles(String userId);

	UserCustomProfile getUserCustomProfile(User user, String name);

	UserCustomProfile getUserCustomProfile(String userId, String name);

	void saveUserProfile(UserProfile profile);

	void saveUserCustomProfile(UserCustomProfile customProfile);

	void startResetPassword(User user);

	void resetPassword(String userId, String newPassword);

	void saveUserEvent(UserEvent userEvent);

}
